package com.dinghui.pay.service.impl;

import com.dinghui.pay.dao.TbOrderMapper;
import com.dinghui.pay.pojo.TbOrder;
import com.dinghui.pay.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;

/**
 * @version 1.0
 * @author: trt
 * @description:
 * @create: 2021-05-30 11:11
 */
@Service
public class OrderServiceImpl implements OrderService {

    //@Autowired
    @Resource
    private TbOrderMapper orderMapper;

    /**
     * 查询用户订单
     */
    @Override
    public ArrayList<TbOrder> getUserOrderList(HashMap map) {
        return orderMapper.getUserOrderList(map);
    }

    @Override
    public int getCount(TbOrder order) {
        return orderMapper.selectCount(order);
    }

    @Override
    public TbOrder getOne(TbOrder order) {
        return orderMapper.selectOne(order);
    }

    @Override
    public void update(TbOrder order) {
        orderMapper.updateByPrimaryKeySelective(order);
    }

    @Override
    public int updateOrderStatus(TbOrder order) {
        return orderMapper.updateOrderStatus(order);
    }


}